package com.wicket.okrbff.biz.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.wicket.okrbff.biz.service.SecurityService;
import com.wicket.okrbff.biz.service.dto.req.*;
import com.wicket.okrbff.biz.service.dto.res.*;
import com.wicket.okrbff.common.ro.OkrResult;
import com.wicket.okrbff.common.ro.OkrResult;
import com.wicket.okrbff.common.util.CommonFunctionHelper;
import com.wicket.okrbff.common.util.RedisUtil;
import javax.annotation.Resource;
import org.apache.skywalking.apm.toolkit.trace.Tag;
import org.apache.skywalking.apm.toolkit.trace.Tags;
import org.apache.skywalking.apm.toolkit.trace.Trace;
import org.springframework.stereotype.Service;
import com.wicket.okrapp.integration.FwAppSecurityClient;
import com.wicket.okrbff.common.exception.Assert;
import com.wicket.okrapp.integration.dto.JudgeDetermineTenantKeyAvailabilityRespDto;
import com.wicket.okrapp.integration.dto.JudgeDetermineTenantKeyAvailabilityReqDto;
import com.wicket.okrapp.integration.dto.JudgeStandardDetermineTenantCertificateAvailabilityAbnormalComRespDto;
import com.wicket.okrapp.integration.dto.JudgeStandardDetermineTenantCertificateAvailabilityAbnormalComReqDto;

/**
 * @author ：
 * @date ：
 *
 *
 * @version 1.0
 */
@Service
public class SecurityServiceImpl implements SecurityService {

  @Resource
  private RedisUtil redisUtil;
@Resource
  FwAppSecurityClient fwAppSecurityClient;
/**
   * B3新增通用租户规划证书及异常(公共)[6601]
   * gen by moon at 5/13/2023, 5:23:28 AM
   */
    @Trace(operationName = "B3新增通用租户规划证书及异常(公共)")
    @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
  @Override
  public BffAddStandardDetermineTenantCertificateAvailabilityAbnormalComRespDto addStandardDetermineTenantCertificateAvailabilityAbnormalCom(BffAddStandardDetermineTenantCertificateAvailabilityAbnormalComReqDto reqDto){
      

       JudgeStandardDetermineTenantCertificateAvailabilityAbnormalComRespDto judgeStandardDetermineTenantCertificateAvailabilityAbnormalComRespDto_1 =null;
//步骤0: D3判断通用租户规划证书及异常(公共) - judgeStandardDetermineTenantCertificateAvailabilityAbnormalCom
     JudgeStandardDetermineTenantCertificateAvailabilityAbnormalComRespDto judgeStandardDetermineTenantCertificateAvailabilityAbnormalComRespDto = null;
    JudgeStandardDetermineTenantCertificateAvailabilityAbnormalComReqDto judgeStandardDetermineTenantCertificateAvailabilityAbnormalComReqDto=new JudgeStandardDetermineTenantCertificateAvailabilityAbnormalComReqDto();
  if(reqDto!=null){
      judgeStandardDetermineTenantCertificateAvailabilityAbnormalComReqDto.setAuthorizationKeyTypeCode(reqDto.getAuthorizationKeyTypeCode());//SimpleFieldAssign//sourceId:932201_1
judgeStandardDetermineTenantCertificateAvailabilityAbnormalComReqDto.setTenantSpaceId(reqDto.getTenantSpaceId());//SimpleFieldAssign//sourceId:927501_1
    }
  
    /*D3判断通用租户规划证书及异常(公共)[6600]   */
    Assert.isNull(judgeStandardDetermineTenantCertificateAvailabilityAbnormalComReqDto.getAuthorizationKeyTypeCode(),"B3新增通用租户规划证书及异常(公共)-D3判断通用租户规划证书及异常(公共)-开通钥匙类型标识不能为空",false);
Assert.isNull(judgeStandardDetermineTenantCertificateAvailabilityAbnormalComReqDto.getTenantSpaceId(),"B3新增通用租户规划证书及异常(公共)-D3判断通用租户规划证书及异常(公共)-租户空间ID不能为空",false);
      judgeStandardDetermineTenantCertificateAvailabilityAbnormalComRespDto = fwAppSecurityClient.judgeStandardDetermineTenantCertificateAvailabilityAbnormalCom(judgeStandardDetermineTenantCertificateAvailabilityAbnormalComReqDto).getData()/*vcase invoke 跨dubbo调用;*/;


      judgeStandardDetermineTenantCertificateAvailabilityAbnormalComRespDto_1 = judgeStandardDetermineTenantCertificateAvailabilityAbnormalComRespDto;

BffAddStandardDetermineTenantCertificateAvailabilityAbnormalComRespDto retData = new BffAddStandardDetermineTenantCertificateAvailabilityAbnormalComRespDto();
  if(judgeStandardDetermineTenantCertificateAvailabilityAbnormalComRespDto_1!=null){
      retData.setKeyOperateType(judgeStandardDetermineTenantCertificateAvailabilityAbnormalComRespDto_1.getKeyOperateType());//SimpleFieldAssign//sourceId:927496_1
retData.setServiceAbnormalWords(judgeStandardDetermineTenantCertificateAvailabilityAbnormalComRespDto_1.getServiceAbnormalWords());//SimpleFieldAssign//sourceId:927497_1
    }

  
  

return retData;
  }
/**
   * B3判断租户规划钥匙可用(管理)[6538]
   * gen by moon at 5/25/2023, 5:07:29 PM
   */
    @Trace(operationName = "B3判断租户规划钥匙可用(管理)")
    @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
  @Override
  public BffJudgeDetermineTenantKeyAvailabilityRespDto judgeDetermineTenantKeyAvailability(BffJudgeDetermineTenantKeyAvailabilityReqDto reqDto){
      
       
       JudgeDetermineTenantKeyAvailabilityRespDto judgeDetermineTenantKeyAvailabilityRespDto_1 =null;
//步骤0: D3判断租户规划钥匙可用 - judgeDetermineTenantKeyAvailability
     JudgeDetermineTenantKeyAvailabilityRespDto judgeDetermineTenantKeyAvailabilityRespDto = null;
    JudgeDetermineTenantKeyAvailabilityReqDto judgeDetermineTenantKeyAvailabilityReqDto=new JudgeDetermineTenantKeyAvailabilityReqDto();
  if(reqDto!=null){
      judgeDetermineTenantKeyAvailabilityReqDto.setPrivacyCode(reqDto.getPrivacyCode());//SimpleFieldAssign//sourceId:911986_1
judgeDetermineTenantKeyAvailabilityReqDto.setAuthorizationKeyTypeCode(reqDto.getAuthorizationKeyTypeCode());//SimpleFieldAssign//sourceId:932186_1
    }
  
    /*D3判断租户规划钥匙可用[6536]   */
    Assert.isNull(judgeDetermineTenantKeyAvailabilityReqDto.getPrivacyCode(),"B3判断租户规划钥匙可用(管理)-D3判断租户规划钥匙可用-权限标识不能为空",false);
Assert.isNull(judgeDetermineTenantKeyAvailabilityReqDto.getAuthorizationKeyTypeCode(),"B3判断租户规划钥匙可用(管理)-D3判断租户规划钥匙可用-开通钥匙类型标识不能为空",false);
      judgeDetermineTenantKeyAvailabilityRespDto = fwAppSecurityClient.judgeDetermineTenantKeyAvailability(judgeDetermineTenantKeyAvailabilityReqDto).getData()/*vcase invoke 跨dubbo调用;*/;
      
      
      judgeDetermineTenantKeyAvailabilityRespDto_1 = judgeDetermineTenantKeyAvailabilityRespDto;
    
BffJudgeDetermineTenantKeyAvailabilityRespDto retData = new BffJudgeDetermineTenantKeyAvailabilityRespDto();
  if(judgeDetermineTenantKeyAvailabilityRespDto_1!=null){
      retData.setIsHaveDisplayPower(judgeDetermineTenantKeyAvailabilityRespDto_1.getIsHaveDisplayPower());//SimpleFieldAssign//sourceId:911994_1
retData.setKeyOperateType(judgeDetermineTenantKeyAvailabilityRespDto_1.getKeyOperateType());//SimpleFieldAssign//sourceId:911995_1
retData.setServiceAbnormalWords(judgeDetermineTenantKeyAvailabilityRespDto_1.getServiceAbnormalWords());//SimpleFieldAssign//sourceId:911996_1
    }
  

  
  
return retData;
  }
  //
}
